<?php

namespace app\api\controller;

use app\api\model\AdminModel;
use app\BaseController;
use think\Exception;

class Admin extends BaseController
{
    public function index()
    {
        try {
            $model = new AdminModel();
            $data = $model->field('id,title,content,image')
                ->where('status', 1)
                ->select()
                ->toArray();
            $this->success('查询成功', $data);
        } catch (Exception $e) {
            $this->error('', $e->getMessage());
        }
    }
}